<script setup >
import uniDataSelect from "../../uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue";
import uniSection from "../../uni_modules/uni-section/components/uni-section/uni-section.vue";
import {ref} from 'vue'
const valueD = ref('');
// 选项数据
// 单选值（使用单个值而非数组）
const singleValueD= ref('');

// 选项数据（保持不变）
const rangeD= ref([
  { "value": 0, "text": "是"},
  { "value": 1, "text": "否" }
]);
// 选择变更事件
const changeD= (eD) => {
  console.log('单选值:', eD);
  console.log("rangeA", rangeD.value);
  console.log("当前选中值", singleValueD.value);
};
const longitude=ref(112.446474)
const latitude=ref(38.014192)
uni.getLocation({
  type: 'wgs84',
  success: function (res) {
    longitude.value=res.longitude
    latitude.value=res.latitude
    console.log('当前位置的经度：' + res.longitude);
    console.log('当前位置的纬度：' + res.latitude);
  }
});
const toNextd=()=>{
  //跳转到子页面
  let flag=confirm("是否确认提交")
  if(flag){
    uni.navigateTo({url:'/studens/return/chneggong'})
  }
}
</script>

<template>
<view id="fx">
  <view class="bjt">
    <image class="tp8" src="/static/image/jingshi.png"></image>
    <view class="tx">亲爱的同学！请务必到家后再提交，谢谢</view>
  </view>
    <uni-section class="cc" title="是否确认到家"  type="line" padding>
      <view class="uni-px-5 uni-pb-5">
        <!-- 单选模式的选择器 -->
        <uni-data-select v-model="singleValueD" :localdata="rangeD" @change="changeD" label="请选择乘车点"
                         mode="selectorA">{{ singleValueD}}</uni-data-select>
      </view>
    </uni-section>
  <uni-section class="cc" title="当前位置"  type="line" padding>

    <view class="content">
      <map id="map" class="map" :show-location="true" :latitude="latitude" :longitude="longitude"></map>
    </view>
    <view class="dw">
      <image class="tp34" src="/static/image/wz.png"></image>
      <view class="wz">中国山西省太原市尖草坪区中北大学</view>
    </view>
  </uni-section>
  <button class="but" type="primary" @click="toNextd">提交</button>
</view>
</template>

<style scoped>
#fx{
  width: 100%;
  height: 100%;
  background-color: #F0F3FA;
}
.tp34{
  width: 25px;
  height: 25px;
  position: relative;
  top: 20px;
  left: 20px;
}
.wz{
  width: 100%;
  height: 17px;
  font-weight: 400;
  font-size: 18px;
  color: #262626;
  letter-spacing: 0;
  position: relative;
  top: -10px;
  left: 60px;
}
.dw{
  width: 100%;
  height: 70px;
  background-color: white;
}
.cc{

  background-color: #F0F3FA;
}
.content {
  flex: 1;
}

.map {
  flex: 1;
}
.tp8{
  width: 25px;
  height: 25px;
  position: relative;
  top: 10px;
  left: 15px;
}
.tx{
  width: 327px;
  height: 17px;
  font-weight: 400;
  font-size: 15px;
  color: #EE7130;
  letter-spacing: 0;
  position: relative;
  left: 55px;
  top: -17px;
}
.bjt{
  background-color: #FFECE2;
  width: 100%;
  height: 50px;
}
.but{
  position: relative;
  top: 20px;
}
</style>